package cn.accp.kzy.model;

import java.text.SimpleDateFormat;
import java.util.Date;
import java.util.HashSet;
import java.util.Set;

import javax.persistence.Entity;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.OneToMany;
import javax.persistence.Table;

@Entity
@Table(name="BBSUsers")
public class BBSUser {
	private int uid;
	private String uname;
	private String upassword;
	private String uemail;
	private String ubirthday;
	private int usex;
	private int uclass = 0;
	private String ustatement;
	private String uregDate = new SimpleDateFormat("yyyy-MM-dd").format(new Date());
	private int ustate = 1;
	private int upoint = 0;
	private String uimgUrl;
	private Set<BBSTopic> topics = new HashSet<BBSTopic>();
	private Set<BBSReply> replys = new HashSet<BBSReply>();
	@Id
	@GeneratedValue
	public int getUid() {
		return uid;
	}
	public void setUid(int uid) {
		this.uid = uid;
	}
	public String getUname() {
		return uname;
	}
	public void setUname(String uname) {
		this.uname = uname;
	}
	public String getUpassword() {
		return upassword;
	}
	public void setUpassword(String upassword) {
		this.upassword = upassword;
	}
	public String getUemail() {
		return uemail;
	}
	public void setUemail(String uemail) {
		this.uemail = uemail;
	}
	public String getUbirthday() {
		return ubirthday;
	}
	public void setUbirthday(String ubirthday) {
		this.ubirthday = ubirthday;
	}
	public int getUsex() {
		return usex;
	}
	public void setUsex(int usex) {
		this.usex = usex;
	}
	public int getUclass() {
		return uclass;
	}
	public void setUclass(int uclass) {
		this.uclass = uclass;
	}
	public String getUstatement() {
		return ustatement;
	}
	public void setUstatement(String ustatement) {
		this.ustatement = ustatement;
	}
	public String getUregDate() {
		return uregDate;
	}
	public void setUregDate(String uregDate) {
		this.uregDate = uregDate;
	}
	public int getUstate() {
		return ustate;
	}
	public void setUstate(int ustate) {
		this.ustate = ustate;
	}
	public int getUpoint() {
		return upoint;
	}
	public void setUpoint(int upoint) {
		this.upoint = upoint;
	}
	public String getUimgUrl() {
		return uimgUrl;
	}
	public void setUimgUrl(String uimgUrl) {
		this.uimgUrl = uimgUrl;
	}
	@OneToMany(mappedBy="user")
	public Set<BBSTopic> getTopics() {
		return topics;
	}
	public void setTopics(Set<BBSTopic> topics) {
		this.topics = topics;
	}
	@OneToMany(mappedBy="user")
	public Set<BBSReply> getReplys() {
		return replys;
	}
	public void setReplys(Set<BBSReply> replys) {
		this.replys = replys;
	}
	
	
	
	
	

	
}

